home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdb / definedb.frm < prev    next >
Text File  |  1995-09-06  |  21KB  |  829 lines

  1. VERSION 2.00
  2. Begin Form DefineDatabase 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Define Database"
  5.    ClientHeight    =   3930
  6.    ClientLeft      =   2040
  7.    ClientTop       =   1905
  8.    ClientWidth     =   5760
  9.    ControlBox      =   0   'False
  10.    Height          =   4335
  11.    Left            =   1980
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3930
  17.    ScaleWidth      =   5760
  18.    Top             =   1560
  19.    Width           =   5880
  20.    Begin CommandButton Command2 
  21.       Caption         =   "E&xit"
  22.       Height          =   372
  23.       Left            =   1920
  24.       TabIndex        =   12
  25.       Top             =   3480
  26.       Width           =   972
  27.    End
  28.    Begin CommandButton Command1 
  29.       Caption         =   "C&reate Database"
  30.       Height          =   372
  31.       Left            =   120
  32.       TabIndex        =   11
  33.       Top             =   3480
  34.       Width           =   1572
  35.    End
  36.    Begin TextBox Text1 
  37.       BackColor       =   &H00C0C0C0&
  38.       Enabled         =   0   'False
  39.       Height          =   732
  40.       Left            =   -120
  41.       TabIndex        =   23
  42.       Top             =   3360
  43.       Width           =   6012
  44.    End
  45.    Begin Frame Fields 
  46.       Caption         =   "Fields"
  47.       Height          =   2292
  48.       Left            =   4080
  49.       TabIndex        =   13
  50.       Top             =   960
  51.       Width           =   1572
  52.       Begin CommandButton Chk_Fld 
  53.          Caption         =   "&Validate"
  54.          Height          =   372
  55.          Left            =   360
  56.          TabIndex        =   17
  57.          Top             =   1800
  58.          Width           =   852
  59.       End
  60.       Begin CommandButton Clear_Fld 
  61.          Caption         =   "&Clear"
  62.          Height          =   372
  63.          Left            =   360
  64.          TabIndex        =   16
  65.          Top             =   1320
  66.          Width           =   852
  67.       End
  68.       Begin CommandButton Last_Fld 
  69.          Caption         =   "&Last"
  70.          Height          =   372
  71.          Left            =   360
  72.          TabIndex        =   15
  73.          Top             =   840
  74.          Width           =   852
  75.       End
  76.       Begin CommandButton Next_Fld 
  77.          Caption         =   "&Next"
  78.          Height          =   372
  79.          Left            =   360
  80.          TabIndex        =   14
  81.          Top             =   360
  82.          Width           =   852
  83.       End
  84.    End
  85.    Begin Frame Frame1 
  86.       Caption         =   "Define Fields"
  87.       Height          =   2292
  88.       Left            =   120
  89.       TabIndex        =   0
  90.       Top             =   960
  91.       Width           =   3852
  92.       Begin TextBox Fld_Dec 
  93.          Enabled         =   0   'False
  94.          Height          =   372
  95.          Left            =   2040
  96.          TabIndex        =   8
  97.          Top             =   1680
  98.          Width           =   612
  99.       End
  100.       Begin TextBox Fld_Log 
  101.          Enabled         =   0   'False
  102.          Height          =   372
  103.          Left            =   1320
  104.          TabIndex        =   9
  105.          Top             =   1680
  106.          Width           =   612
  107.       End
  108.       Begin TextBox Fld_Len 
  109.          Height          =   372
  110.          Left            =   2040
  111.          TabIndex        =   5
  112.          Top             =   1200
  113.          Width           =   612
  114.       End
  115.       Begin TextBox WhichFld 
  116.          Height          =   372
  117.          Left            =   1320
  118.          TabIndex        =   19
  119.          Text            =   "1"
  120.          Top             =   1200
  121.          Width           =   612
  122.       End
  123.       Begin ComboBox Fld_Type 
  124.          Height          =   288
  125.          Left            =   1320
  126.          Sorted          =   -1  'True
  127.          TabIndex        =   4
  128.          Text            =   "Combo1"
  129.          Top             =   732
  130.          Width           =   2292
  131.       End
  132.       Begin TextBox Fld_Name 
  133.          Height          =   372
  134.          Left            =   1320
  135.          TabIndex        =   1
  136.          Top             =   252
  137.          Width           =   2292
  138.       End
  139.       Begin Label Label4 
  140.          Caption         =   "&Decimals"
  141.          Height          =   252
  142.          Left            =   2760
  143.          TabIndex        =   7
  144.          Top             =   1800
  145.          Width           =   852
  146.       End
  147.       Begin Label Label5 
  148.          Alignment       =   1  'Right Justify
  149.          Caption         =   "Lo&gical"
  150.          Height          =   252
  151.          Left            =   480
  152.          TabIndex        =   10
  153.          Top             =   1800
  154.          Width           =   732
  155.       End
  156.       Begin Label Label3 
  157.          Caption         =   "L&ength"
  158.          Height          =   252
  159.          Left            =   2760
  160.          TabIndex        =   6
  161.          Top             =   1320
  162.          Width           =   612
  163.       End
  164.       Begin Label Label6 
  165.          Alignment       =   1  'Right Justify
  166.          Caption         =   "&Field no."
  167.          Height          =   252
  168.          Left            =   360
  169.          TabIndex        =   18
  170.          Top             =   1320
  171.          Width           =   852
  172.       End
  173.       Begin Label Label2 
  174.          Alignment       =   1  'Right Justify
  175.          Caption         =   "Field &Type"
  176.          Height          =   252
  177.          Left            =   240
  178.          TabIndex        =   3
  179.          Top             =   768
  180.          Width           =   972
  181.       End
  182.       Begin Label Label1 
  183.          Alignment       =   1  'Right Justify
  184.          Caption         =   "Field &Name"
  185.          Height          =   252
  186.          Left            =   120
  187.          TabIndex        =   2
  188.          Top             =   324
  189.          Width           =   1092
  190.       End
  191.    End
  192.    Begin Frame Frame2 
  193.       Caption         =   "DBF Name"
  194.       Height          =   732
  195.       Left            =   120
  196.       TabIndex        =   20
  197.       Top             =   120
  198.       Width           =   5532
  199.       Begin TextBox DBF_Name 
  200.          Height          =   372
  201.          Left            =   2040
  202.          TabIndex        =   22
  203.          Text            =   "NEW.DBF"
  204.          Top             =   240
  205.          Width           =   3012
  206.       End
  207.       Begin Label Label7 
  208.          Alignment       =   1  'Right Justify
  209.          Caption         =   "Data&base name"
  210.          Height          =   252
  211.          Left            =   480
  212.          TabIndex        =   21
  213.          Top             =   360
  214.          Width           =   1452
  215.       End
  216.    End
  217. End
  218.  
  219. 'Code for Visual Basic 1.0 and Windows 3.0
  220. '(C)1991 Marquis Computing. All Rights Reserved.
  221. '
  222. 'Form DefintDatabase
  223. '-------------------
  224. 'Gets user input, performs entry validation, verifies structure and builds
  225. 'a FldInfo type array that may be used by other VBDB^ routines to create
  226. 'a dBASE* III+ compatible database.
  227. '
  228. '^VBDB(C)1991 Marquis Computing, parts (C)1990 Marquis Computing.
  229. ' VBDB is a tradmark of Marquis Computing.
  230. '
  231. '*dBASE and dBASE III+ are trademarks of Ashton-Tate.
  232. '
  233.  
  234.     DefInt A-Z
  235.     
  236.     '
  237.     'Fld() is an array which carries information to define a database
  238.     'header. The constants are used to make using this easier. Fld() is
  239.     'defined as follows --
  240.     '
  241.     'Element #:
  242.     '
  243.     '           1 = decimal flag (-1 or 0)
  244.     '           2 = field length
  245.     '           3 = field type (String * 1)
  246.     '           4 = field name (String * 12)
  247.     '           5 = location of field
  248.     '
  249.     
  250.     Const Decimal = 1
  251.     Const FLen = 2
  252.     Const FType = 3
  253.     Const FName = 4
  254.     Const OffSet = 5
  255.  
  256.     Dim Fld() As String
  257.  
  258. Sub Chk_Fld_Click ()
  259.  
  260.     '
  261.     'Verifies a flieds data
  262.     '
  263.     
  264.     ThisFld = Val(WhichFld.Text)
  265.     VerifyData Status, ThisFld
  266.     If Not Status Then MsgBox "field definition ok", 64, "Validate Fields"
  267.     
  268. End Sub
  269.  
  270. Sub Clear_Fld_Click ()
  271.     
  272.     '
  273.     'Clears out a fields data. If the current field is the last field,